import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '*',
      redirect: '/'
    },
    {
      path: '/',
      redirect: '/userindex'
    },
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // },
    {
      path: '/home',
      name: 'home',
      component: resolve => require(['../views/home/home'], resolve),
      children:[
        {
          path: '/login',    /*登录 */
          name: 'login',
          component: resolve => require(['../views/home/login'], resolve).default,
        },
        {
          path: '/register',    /*注册 */
          name: 'register',
          component: resolve => require(['../views/home/register'], resolve).default,
        },
        {
          path: '/forgetpawy',    /*忘记密码   邮箱找回 */
          name: 'forgetpawy',
          component: resolve => require(['../views/home/forgetpawy'], resolve).default,
        },
        {
          path: '/forgetpawm',    /*忘记密码   手机号找回 */
          name: 'forgetpawm',
          component: resolve => require(['../views/home/forgetpawm'], resolve).default,
        },
        {
          path: '/resetpwd',    /*重置登录密码 */
          name: 'resetpwd',
          component: resolve => require(['../views/home/resetpwd'], resolve).default,
        },
      ]
    },
    {
      path: '/mainHome',  //公共导航头部尾部
      name: 'mainHome',
      component: resolve => require(['../views/mainHome/mainHome'], resolve),
      children:[
        {
          path: '/userindex',    /*首页 */
          name: 'userindex',
          component: resolve => require(['../views/mainHome/userindex'], resolve).default,
        },
        {
          path: '/developerindex',    /* 开发者首页 */
          name: 'developerindex',
          component: resolve => require(['../views/developerindex'], resolve).default,
        },
        {
          path: '/projectslist',    /*项目大厅 */
          name: 'projectslist',
          component: resolve => require(['../views/mainHome/projectslist'], resolve).default,
        },
        {
          path: '/projectsdetail',    /*项目详情 */
          name: 'projectsdetail',
          component: resolve => require(['../views/mainHome/projectsdetail'], resolve).default,
        },
        {
          path: '/projectsbidding',    /*竞标页 */
          name: 'projectsbidding',
          component: resolve => require(['../views/mainHome/projectsbidding'], resolve).default,
        },
        {
          path: '/homepage',    /*个人主页 */
          name: 'homepage',
          component: resolve => require(['../views/mainHome/homepage'], resolve).default,
        },
        {
          path: '/publishtype',    /*发布类型选择页 */
          name: 'publishtype',
          component: resolve => require(['../views/mainHome/publishtype'], resolve).default,
        },
        {
          path: '/publishedit',    /*发布页 */
          name: 'publishedit',
          component: resolve => require(['../views/mainHome/publishedit'], resolve).default,
        },
        {
          path: '/codelist',    /*源码列表 */
          name: 'codelist',
          component: resolve => require(['../views/mainHome/codelist'], resolve).default,
        },
        {
          path: '/codedetail',    /*源码详情 */
          name: 'codedetail',
          component: resolve => require(['../views/mainHome/codedetail'], resolve).default,
        },
        {
          path: '/codeedit',    /*发布源码 */
          name: 'codeedit',
          component: resolve => require(['../views/mainHome/codeedit'], resolve).default,
        },
        {
          path: '/ucenter',    /*个人中心 */
          name: 'ucenter',
          component: resolve => require(['../views/mainHome/ucenter/ucenter'], resolve),
          children:[
            {
              path: '/personalinfo',    /*基本信息 */
              name: 'personalinfo',
              component: resolve => require(['../views/mainHome/ucenter/personalinfo'], resolve).default,
            },
            {
              path: '/company',    /*企业信息 */
              name: 'company',
              component: resolve => require(['../views/mainHome/ucenter/company'], resolve).default,
              children:[
                {
                  path: '/company/companyinfo',    /*企业信息详情 */
                  name: 'companyinfo',
                  component: resolve => require(['../views/mainHome/ucenter/companyinfo'], resolve).default,
                },
                {
                  path: '/company/companyedit',    /*修改企业信息 */
                  name: 'companyedit',
                  component: resolve => require(['../views/mainHome/ucenter/companyedit'], resolve).default,
                },
              ],
            },
            {
              path: '/skill',    /*技能信息 */
              name: 'skill',
              component: resolve => require(['../views/mainHome/ucenter/skill'], resolve),
              children:[
                {
                  path: '/skill/skillinfo',    /*技能信息详情 */
                  name: 'skillinfo',
                  component: resolve => require(['../views/mainHome/ucenter/skillinfo'], resolve).default,
                },
                {
                  path: '/skill/skilledit',    /*技能信息编辑 */
                  name: 'skilledit',
                  component: resolve => require(['../views/mainHome/ucenter/skilledit'], resolve).default,
                },
              ],
            },
            
            {
              path: '/personalauth',    /*实名认证 */
              name: 'personalauth',
              component: resolve => require(['../views/mainHome/ucenter/personalauth'], resolve).default,
            },
            {
              path: '/companyauth',    /*企业认证 */
              name: 'companyauth',
              component: resolve => require(['../views/mainHome/ucenter/companyauth'], resolve).default,
            },
            {
              path: '/case',    /*项目案例 */
              name: 'case',
              component: resolve => require(['../views/mainHome/ucenter/case'], resolve).default,
              children:[
                {
                  path: '/case/itemcase',    /*项目案例  列表 */
                  name: 'itemcase',
                  component: resolve => require(['../views/mainHome/ucenter/itemcase'], resolve).default,
                },
                {
                  path: '/case/addcase',    /*新增项目案例 */
                  name: 'addcase',
                  component: resolve => require(['../views/mainHome/ucenter/addcase'], resolve).default,
                },
              ],
            },
            {
              path: '/accoutbind',    /*账号绑定 */
              name: 'accoutbind',
              component: resolve => require(['../views/mainHome/ucenter/accoutbind'], resolve).default,
            },
            {
              path: '/integral',    /*积分任务 */
              name: 'integral',
              component: resolve => require(['../views/mainHome/ucenter/integral'], resolve).default,
            },
            {
              path: '/integralrecord',    /*积分记录 */
              name: 'integralrecord',
              component: resolve => require(['../views/mainHome/ucenter/integralrecord'], resolve).default,
            },
          ],
        },
        {
          path: '/housekeeper',    /*项目管家页 */
          name: 'housekeeper',
          component: resolve => require(['../views/mainHome/housekeeper'], resolve).default,
        },
        {
          path: '/workbench',  /*工作台 */
          name: 'workbench',
          component: resolve => require(['../views/workbench/workbench'], resolve),
          children:[
            {
              path: '/receiveditem',  /*接包项目 */
              name: 'receiveditem',
              component: resolve => require(['../views/workbench/receiveditem'], resolve),
            },
            {
              path: '/senditem',  /*发包项目 */
              name: 'senditem',
              component: resolve => require(['../views/workbench/senditem'], resolve),
            },
            {
              path: '/readypushitem',  /*待发布 */
              name: 'readypushitem',
              component: resolve => require(['../views/workbench/readypushitem'], resolve),
            },
            {
              path: '/sendcode',  /* 源码 - 已发布 */
              name: 'sendcode',
              component: resolve => require(['../views/workbench/sendcode'], resolve),
            },
            {
              path: '/readypushcode',  /* 源码 - 待发布 */
              name: 'readypushcode',
              component: resolve => require(['../views/workbench/readypushcode'], resolve),
            },
            {
              path: '/evaluate',  /*评价 */
              name: 'evaluate',
              component: resolve => require(['../views/workbench/evaluate'], resolve),
            },
          ]
        },
        {
          path: '/workbench/item',  /*工作台  ->  发包  ->  项目 */
          name: 'workbenchItem',
          component: resolve => require(['../views/workbench/item/item'], resolve),
          children:[
            {
              path: '/workbench/bidding',  /*项目  ->  竞标 */
              name: 'workbenchBidding',
              component: resolve => require(['../views/workbench/item/bidding'], resolve),
            },
            {
              path: '/workbench/details',  /*项目  ->  详情 */
              name: 'workbenchDetails',
              component: resolve => require(['../views/workbench/item/details'], resolve),
            },
          ]
        },
        {
          path: '/workbench/itemr',  /*工作台  ->  接包  ->  项目 */
          name: 'workbenchItemR',
          component: resolve => require(['../views/workbench/itemr/item'], resolve),
          children:[
            {
              path: '/workbench/case',  /*项目  ->  竞标方案 */
              name: 'workbenchCase',
              component: resolve => require(['../views/workbench/itemr/case'], resolve),
            },
            {
              path: '/workbench/detailsr',  /*项目  ->  详情 */
              name: 'workbenchDetailsR',
              component: resolve => require(['../views/workbench/itemr/details'], resolve),
            },
          ]
        },
        {
          path: '/help',    /* 帮助中心 */
          name: 'help',
          component: resolve => require(['../views/help'], resolve).default,
        },
        {
          path: '/rules',    /* 规则协议 */
          name: 'rules',
          component: resolve => require(['../views/rule'], resolve).default,
        },
        {  //用户反馈
          path: '/userfeedback',
          name: 'userfeedback',
          component: resolve => require(['../views/userfeedback'], resolve).default,
        },
        {  //通知中心
          path: '/notification',
          name: 'notification',
          component: resolve => require(['../views/notification'], resolve).default,
        },
        {  //资金账户
          path: '/capitalaccount',
          name: 'capitalaccount',
          component: resolve => require(['../views/capitalAccount/capitalaccount'], resolve),
          children:[
            {
              path: '/dashboard',  /*资金账户  ->  会员类型 */
              name: 'dashboard',
              component: resolve => require(['../views/capitalAccount/dashboard'], resolve),
            },
            {
              path: '/recharge',  /*资金账户  ->  开通会员 */
              name: 'recharge',
              component: resolve => require(['../views/capitalAccount/recharge'], resolve),
            },
          ]
        },
      ]
    },
    {
      path: '/index',    /* 首页 */
      name: 'index',
      component: resolve => require(['../views/index'], resolve).default,
    },
    {
      path: '/qualityplan',    /* 优质开发商计划首页 */
      name: 'qualityplan',
      component: resolve => require(['../views/qualityplan'], resolve).default,
    },
    {
      path: '/contractaward',
      name: 'contractaward',
      component: resolve => require(['../views/contractaward/contractaward'], resolve),
      children:[
        {
          path: '/treasure/:type',  /*发包宝典 */
          name: 'treasure',
          component: resolve => require(['../views/contractaward/treasure'], resolve),
        },
      ]
    },
    

  ]
})
